<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>芯片扫描入库</title>
		<link rel="stylesheet" href="./layui/css/layui.css">
		<!-- <link rel="stylesheet" href="./4/lumen/bootstrap.css" media="screen"/> -->
		<script src="./layui/layui.js"></script>
		<script src="./js/jquery.min.js"></script>
		<script src="./js/jquery.qrcode.min.js"></script>
		<script>
			$(document).ready(function(){
				
				var print_click = "print"; //打印的按钮的id
				
				//这里载入之后是生成二维码
				//$("#PO_Str").html($("#pocode").val());
				$("#qrcodeTable").qrcode({
					render: "table", // 渲染方式有table方式（IE兼容）和canvas方式
					width: 120, //宽度
					height: 120, //高度
					text: utf16to8("asda"), //内容
					typeNumber: -1,//计算模式
					correctLevel: 2,//二维码纠错级别
					background: "#ffffff",//背景颜色
					foreground: "#000000" //二维码颜色
				});
			});
			function utf16to8(str) {
				var out, i, len, c;
				out = "";
				len = str.length;
				for (i = 0; i < len; i++) {
					c = str.charCodeAt(i);
					if ((c >= 0x0001) && (c <= 0x007F)) {
						out += str.charAt(i);
					} else if (c > 0x07FF) {
						out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
						out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
						out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
					} else {
						out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
						out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
					}
				}
				return out;
			}
		</script> 
	</head>
	<body>
		<div class="layui-tab">
			
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
					<!-- 这里是需要打印的区域,也就是二维码区域 -->
					<div id="print_content">
						<div align="left" class="layui-row">
							<div id="qrcodeTable" class="layui-col-sm2"></div>
						</div>
						<div align="left" class="layui-row">
							<div id="PO_Str" class="layui-col-sm2"></div>
						</div>
					</div>
					</div>
			</div>
		</div>
		
	</body>
</html>